<?php
function get_host_id_from_tran($module_serial,$datetime){
	$host_id = db_fetch_cell('SELECT host_id from plugin_nms_modulelog 
				where module_serial = "'.$module_serial.'" and module_date = "'.$datetime.'"');
	return $host_id;
}
function get_sum_port_used($host_id ,$datetime,$slot){
	$sum = db_fetch_cell('SELECT COUNT(*) from plugin_nms_translog 
			where host_id ='.$host_id.' and trans_date = "'.$datetime.'"  and port_pause = 1 and port_name like "__'.$slot.'/%"');
	return $sum;
}
function get_sum_port_empty($host_id,$datetime,$slot){
	$sum = db_fetch_cell('SELECT COUNT(*) from plugin_nms_translog
			where host_id ='.$host_id.' and trans_date = "'.$datetime.'" and port_pause =0 and trans_name="" and port_name like "__'.$slot.'/%" ');
	return $sum;
}
function get_sum_port_notuse($host_id,$datetime,$slot){
	$sum = db_fetch_cell('SELECT COUNT(*) from plugin_nms_translog
			where host_id ='.$host_id.' and trans_date = "'.$datetime.'" and port_pause =0 and trans_name !="" and port_name like "__'.$slot.'/%" ');
	return $sum;
}
?>